<%@ page import="hp.com.entity.Users" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
    String path = request.getContextPath();
    request.setAttribute("path",path);
    Users userSession =(Users) request.getSession().getAttribute("userSession");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="${path}/jbs/text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="${path}/jbs/css/style.css" />
    <!--[if IE 6]>
    <script src="js/iepng.js" type="${path}/jbs/text/javascript"></script>
    <script type="text/javascript">
        EvPNG.fix('div, ul, img, li, input, a');
    </script>
    <![endif]-->

    <script type="text/javascript" src="${path}/jbs/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="${path}/jbs/js/menu.js"></script>

    <script type="text/javascript" src="js/select.js"></script>

    <script>
       function addressSubmit(){
           if(document.getElementById("detail").value!=""&&document.getElementById("name")!=""&&document.getElementById("phone")!=""){
            document.forms["addressForm"].submit();
           }else{
               alert("地址信息填写不完整！")
           }
        }
    </script>
    <link rel="icon" href="<%=path%>/jbs/images/ico.ico" type="image/x-icon">
    <title>地址管理-青鸟优选</title>
</head>
<body style="margin:0">
<!--Begin Header Begin-->
<div class="soubg">
    <div class="sou">
        <span class="fr">
        	<span class="fl">
                <c:choose>
                    <c:when test="<%= userSession == null%>">
                        <a href="${path}/jbs/Regist.jsp" style="color:##02A4F8;">免费注册</a>&nbsp;|&nbsp;
                         <a href="${path}/jbs/Login.jsp" style="color:##02A4F8;">马上登录</a>
                    </c:when>
                    <c:otherwise>
                        <%=userSession.getLoginname()%> |&nbsp;<a href="${path}/User">个人中心</a> | <a href="${path}/Orders">我的订单</a> |
                        <a href="${path}/Cart#showCart">购物车</a>
                    </c:otherwise>
                </c:choose>&nbsp;
            </span>
        </span>
    </div>
</div>
<div class="m_top_bg">
    <div class="top">
        <div class="m_logo"><a href="${path}/Index"><img src="${path}/jbs/images/logo1.png" /></a></div>
        <div class="m_search">
            <form>
                <input type="text" value="" class="m_ipt" />
                <input type="submit" value="搜索" class="m_btn" />
            </form>
        </div>
    </div>
</div>
<!--End Header End-->
<div class="i_bg bg_color">
    <!--Begin 用户中心 Begin -->
    <div class="m_content">
        <div class="m_left">
            <div class="left_n">管理面板</div>
            <div class="left_m" style="padding: 0">
                <div class="left_m_t t_bg2">会员中心</div>
                <ul>
                    <a href="${path}/User" ><li >用户信息</li></a>
                    <a href="${path}/Address"><li style="background-color: #02A4F8;color: #FFFFFF">地址管理</li></a>
                    <a href="${path}/jbs/Member_Collect.jsp"><li>我的收藏</li></a>
                </ul>
            </div>
            <div class="left_m" style="padding: 0">
                <div class="left_m_t t_bg1">订单中心</div>
                <ul>
                    <a href="${path}/Orders"> <li>我的订单</li></a>
                </ul>
            </div>
            <div class="left_m" style="padding: 0">
                <div class="left_m_t t_bg3">安全中心</div>
                <ul>
                    <a href="${path}/jbs/Member_Safe.jsp"><li>账户安全</li></a>
                </ul>
            </div>
        </div>
        <div class="m_right">
            <p></p>
            <div class="mem_tit">收货地址</div>
            <c:forEach items="${requestScope.addressList}" begin="0" end="${fn:length(requestScope.addressList)}" var="item" varStatus="i">
                <div class="address">
                    <div class="a_close"><a href="#"><img src="${path}/jbs/images/a_close.png" /></a></div>
                    <table border="0" class="add_t" align="center" style="width:98%; margin:10px auto;" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                ${item.locDetail}
                            </td>
                        </tr>
                        <tr>
                            <td>
                                联系人：${item.contactName}
                            </td>
                        </tr>
                        <tr><td>联系电话：${item.contactNumber}</td></tr>
                    </table>
                        <%--                <p align="right">--%>
                        <%--                    <a href="#" style="color:##02A4F8;">设为默认</a>&nbsp; &nbsp; &nbsp; &nbsp; <a href="#" style="color:##02A4F8;">编辑</a>&nbsp; &nbsp; &nbsp; &nbsp;--%>
                        <%--                </p>--%>
                </div>
            </c:forEach>

            <a name="addNew"></a>
            <div class="mem_tit">
                新地址
            </div>
            <form action="/AddAddress" id="addressForm">
            <table border="0" class="add_tab" style="width:930px;"  cellspacing="0" cellpadding="0">
                <tr>
                    <td align="right">详细地址</td>
                    <td style="font-family:'宋体';" colspan="3"><input type="text" id="detail" class="add_ipt" name="address" style="width: 700px" placeholder="请输入详细地址" required="required"/>（必填）</td>
                </tr>
                <tr>
                    <td align="right">收货人姓名</td>
                    <td style="font-family:'宋体';"><input type="text" class="add_ipt" id="name"  name="Name" placeholder="姓名" required="required"/>（必填）</td>
                    <td align="right">联系人电话</td>
                    <td style="font-family:'宋体';"><input type="text" class="add_ipt" id="phone" name="Phone" placeholder="手机号" required="required"/>（必填）</td>
                </tr>
            </table>
            <p align="right">

                 <a class="add_b" onclick="addressSubmit()">确认添加</a>
            </p>
            </form>


        </div>
    </div>
    <!--End 用户中心 End-->
    <!--Begin Footer Begin -->
    <div class="b_btm_bg b_btm_c">
        <div class="b_btm">
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="${path}/jbs/images/b1.png" width="62" height="62" /></td>
                    <td><h2>正品保障</h2>正品行货  放心购买</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="${path}/jbs/images/b2.png" width="62" height="62" /></td>
                    <td><h2>满38包邮</h2>满38包邮 免运费</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="${path}/jbs/images/b3.png" width="62" height="62" /></td>
                    <td><h2>天天低价</h2>天天低价 畅选无忧</td>
                </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="72"><img src="${path}/jbs/images/b4.png" width="62" height="62" /></td>
                    <td><h2>准时送达</h2>收货时间由你做主</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="btmbg">
        <div class="btm">
            <a href="https://beian.miit.gov.cn">备案/许可证编号：鄂ICP备20008779号-1</a> <br />本站仅供个人学习实践，无实际购买功能
        </div>
    </div>
    <!--End Footer End -->
</div>

</body>
</html>

